Wireshark doesn't work for my Win7 PC. Neither does WinDump or any other method. For example I have this code in C#
Code:
mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
mainSocket.Bind(new IPEndPoint(IPAddress.Parse(cmbInterfaces.Text), 0));
mainSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, true);
byte[] byTrue = new byte[4] { 1, 0, 0, 0 };
byte[] byOut = new byte[4] { 0, 0, 0, 0 }; //Capture outgoing packets
mainSocket.IOControl(IOControlCode.ReceiveAll, byTrue, byOut);
Which should start a simple socket to listen to all incoming packets. I get an exception thrown (SocketException) on IOControl. If I change the parameters it runs, but it doesn't do what I want.
Using winsock2.h in a C++ attempt, doesn't work either (gives an error when I bind). So The above code works for a WinXP PC I have, but not on this Win7 PC I have. I am guessing it is a general problem.
Any ideas? I am running them as administrator of course in Win7/Vista